<template>
	<view class="content">
		<view class="header">
			<view class="headerBottom">
				<image :src="$isHttp(details.logoImageUrl)" mode=""></image>
				<view class="myMessage">
					<text>{{details.companyName}}</text>
					<text class="going">
						{{details.auditStatus===1?'待审核 ':details.auditStatus===2?'已审核':'驳回'}}
					</text>
				</view>
			</view>
		</view>
		<view class="main">
			<view class="card">
				<image src="/static/my/my1.png" mode="" @tap="nextPage(`/pages/myRelease/myRelease`)"></image>
				<image src="/static/my/my2.png" mode="" @tap="nextPage(`/pages/myEmploy/myEmploy`)"></image>
			</view>
			<view class="list">
				<view class="like" @tap="nextPage(`/pages/myCollect/myCollect`)">
					<view class="likeLeft">
						<image src="/static/my/icon2.png" mode=""></image>
						<text>我的收藏</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="36"></u-icon>
				</view>
				<view class="set" @tap="nextPage(`/pages/mySet/mySet?type=big`)">
					<view class="setLeft">
						<image src="/static/my/icon1.png" mode=""></image>
						<text>设置</text>
					</view>
					<u-icon name="arrow-right" color="#999999" size="36"></u-icon>
				</view>
			</view>

			<view class="btn buttom">
				<button type="default" @tap="onAUrl">返回学生端 </button>
			</view>
		</view>
		<Tabbar :current="3"></Tabbar>
	</view>
</template>

<script>
	import {
		companyInfo
	} from '@/api/company'
	export default {
		onShow() {
			uni.hideTabBar({
				animation: false
			})
		},
		onLoad() {
			this.companyInfo()
		},
		data() {
			return {
				details: {}, //公司信息
			}
		},
		methods: {
			onAUrl() {
				window.location.href = `https://em-h5.redcross668.com/#/`;
			},
			//跳转列表对应页面
			nextPage(url) {
				uni.navigateTo({
					url: url,
					fail() {
						uni.switchTab({
							url: url,
							fail() {
								uni.showToast({
									title: '暂未开通，敬请期待！',
									icon: 'none'
								});
							}
						});
					}
				});
			},
			//企业信息-通过id查询
			companyInfo() {
				companyInfo(this.$store.state.userInfo.companyId).then(res => {
					this.details = res.result
				}).catch(err => {
					console.log(err)
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background: linear-gradient(90deg, #52B8B2 0%, #5EC8A3 100%);
		height: 500rpx;

		.header {
			.title {
				position: relative;
				width: 100%;
				height: 70rpx;
				line-height: 70rpx;
				text-align: center;

				.u-icon {
					position: absolute;
					height: 70rpx;
					left: 20rpx;
				}

				text {
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: bold;
					color: #FFFFFF;
				}
			}

			.headerBottom {
				margin: 0rpx 25rpx;
				display: flex;
				align-items: center;
				padding: 30rpx 0rpx;

				image {
					margin-right: 20rpx;
					width: 120rpx;
					height: 120rpx;
					border-radius: 50%;
				}

				.myMessage {
					text {
						font-size: 28rpx;
						letter-spacing: 2rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #FFFFFF;
					}

					.going {
						margin-top: 10rpx;
						display: block;
						font-size: 26rpx;
						font-weight: 500;
					}
				}
			}
		}

		.main {
			background: #FFFFFF;
			border-radius: 30rpx;

			.card {
				padding-top: 40rpx;
				text-align: center;

				image {
					width: 340rpx;
					height: 180rpx;
				}

				image:last-child {
					margin-left: 10rpx;
				}
			}

			.list {
				margin-top: 40rpx;

				.like {
					margin: 0 30rpx 30rpx 30rpx;
					padding: 0 0 30rpx 0;
					border-bottom: #EFEFEF 2rpx solid;
					display: flex;
					justify-content: space-between;

					.likeLeft {
						display: flex;
						align-items: center;

						image {
							margin-right: 15rpx;
							width: 40rpx;
							height: 40rpx;
						}
					}
				}

				.set {
					padding: 0 30rpx;
					display: flex;
					justify-content: space-between;

					.setLeft {
						display: flex;
						align-items: center;

						image {
							margin-right: 15rpx;
							width: 40rpx;
							height: 40rpx;
						}
					}
				}
			}
		}
	}

	.buttom {
		position: fixed;
		bottom: 140rpx;
		left: 0;
		width: 100%;

		button {
			width: 80%;
			text-align: center;
		}
	}
</style>
